package main

import (
	"github.com/gomodule/redigo/redis"
	"time"
)

var pool  *redis.Pool

// initPool
func initPool(addr string, maxIdle int, idleTimeOut time.Duration) {
	pool = &redis.Pool{
		MaxIdle:     maxIdle,
		MaxActive:   0,
		IdleTimeout: idleTimeOut,
		Dial: func() (redis.Conn, error) {
			return redis.Dial("tcp", addr + ":6379")
		},
	}
}
